calculating resistance worked example